#ifndef CONFIG_H
#define CONFIG_H

#include <stdint.h>
#include <stdbool.h>
#include "common.h"

typedef struct {
    uint32_t polling_interval_ms;

    struct {
        uint32_t duration_hours;
        uint32_t duration_minutes;
        uint32_t duration_seconds;
    } test_duration;
    
    struct {
        uint32_t start_address;
        uint32_t end_address;
    } input_register_range;

    struct {
        uint32_t start_address;
        uint32_t end_address;
    } holding_register_range;

    struct {
        char ip[MAX_IP_LENGTH];
        uint32_t port;
        uint32_t slave_id;
        bool disable_nagle;
    } modbus_servers[4];

    rt_config_t rt_configs[4];

} config_t;

int load_config(const char* filename, config_t* config);

#endif
